/*******************************************************************************
 * Copyright 2010 Simon Mieth
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 ******************************************************************************/
package cn.kkdlk.parse.common;

import cn.kkdlk.parse.DraftDocument;
import cn.kkdlk.parse.math.Bounds;
import cn.kkdlk.parse.math.Extrusion;


public interface DraftEntity {

    long getID();

    Type<?> getType();

    Bounds getBounds();

    boolean isVisibile();

    void setVisibile(boolean b);

    boolean isModelSpace();

    int getColor();

    void setColor(int i);

    byte[] getColorRGB();

    int getLineWeight();

    DraftDocument getDocument();

    void setDocument(DraftDocument doc);

    double getLinetypeScaleFactor();

    boolean isOmitLineType();

    boolean hasLineType();

    Layer getLayer();

    void setLayer(Layer layer);

    LineType getLineType();

    Extrusion getExtrusion();

    long getOwnerID();

    int getFlags();

    double getLength();

    /**
     * Ensures that the DraftEntity's coordinates are in WCS rather than OCS.
     * Should only ever be called on completely built entities, i.e. after
     * the entity's group has benn parsed entirely.
     * <p>
     * Implementing this method is necessary only for planar entities
     * (circle, arc, solid, trace,text, attrib, attdef, shape, insert, 2Dpolyline,
     * 2D vertex, lwpolyline, hatch, image),
     * since their coordinates get stored in the OCS.
     * <p>
     * In this case the method does not simply translate the coordinates, but
     * "reverts" the arbitrary axis algorithm's effects. This means that an Entity
     * with Extrusion != (0,0,1), that might have appeared "flipped" without the
     * transformation, will be "unflipped".
     * <p>
     * 3D-Entities
     * (line, point, 3dface, 3Dpolyline, 3D vertex, 3D mesh, 3D meshvertex)
     * can leave this method's body empty, since their coordinates are already
     * in WCS. For them this method should do nothing.
     *
     * @return the DraftEntity with its coordinates in WCS
     */
    void toWcs();

}
